﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class TongZhiModel
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _Year;
        [DataMember]
        public int Year
        {
            get { return _Year; }
            set { _Year = value; }
        }

        private string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        private string _Content;
        [DataMember]
        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }

        public static TongZhiModel FillEntity(DataRow dr)
        {
            TongZhiModel right = new TongZhiModel();
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) right.Sec = Convert.ToInt32(dr["Sec"]);
            right.ID = (int)dr["ID"];
            right.Year = (int)dr["Year"];
            right.Type = dr["Type"] as string;
            right.Content = dr["Content"] as string;
            return right;
        }
    }
}
